#ifndef KERNEL_DEBUG_H
#define KERNEL_DEBUG_H
/*
 * 实现断言
 * 形式: ASSERT();
 * */
void panic_spin(char* filename, int line, const char* func, const char* condition);

#define PANIC(...) panic_spin (__FILE__, __LINE__, __func__, __VA_ARGS__)

#ifdef NDEBUG
    #define ASSERT(CONDITION)((void)0)
#else
#define ASSERT(CONDITION) \
if (CONDITION) {} else { \
    PANIC(#CONDITION);   \
}
#endif // NDEBUG
#endif // KERNEL_DEBUG_H
